package com.ppt.panel;

import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import com.ppt.frame.MainFrame;
import com.ppt.operario.IntroducirOTPanel;

@Entity
public class OperarioPanel extends JPanel implements ActionListener{

	private static final long serialVersionUID = 1L;
	@ManyToOne
	private MainFrame frame;
	
	private JButton btnDatosPersonales, btnConfiguracion, btnConsultaDeOrdenes;
	@ManyToOne
	private IntroducirOTPanel panelOT;

	protected OperarioPanel() {
	}

	public OperarioPanel(MainFrame frame) {
		
		this.frame = frame;
		setBorder(new EmptyBorder(50, 50, 50, 50));
		setLayout(new GridLayout(2, 2, 20, 20));
		
		btnDatosPersonales = new JButton("Datos Personales");
		add(btnDatosPersonales);
		
		panelOT = new IntroducirOTPanel(frame);
		add(panelOT);
		
		btnConfiguracion = new JButton("Configuracion");
		add(btnConfiguracion);
		
		btnConsultaDeOrdenes = new JButton("Consulta de Ordenes de Trabajo");
		add(btnConsultaDeOrdenes);
		
		addListeners();
	}
	
	public void addListeners(){
		btnDatosPersonales.addActionListener(this);
		btnConfiguracion.addActionListener(this);
		btnConsultaDeOrdenes.addActionListener(this);
	}

	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == btnConsultaDeOrdenes){
;
		}
		
	}
	
}
